
<table id="summarytable" style="width: 400px;text-align: right;float:right">

    
    <tr>
        <td><a href="javascript:void(0)" id="applyCredit">Apply Credit</a></td>
        <td>Material cost</td>
        <td id="materialcost"></td>
        <td>Subtotal</td>
        <td id="subtotal"></td>
        

    </tr>
    <tr>
        <td></td>
        <td>Labor cost</td>
        <td id="laborcost"></td>
        <td>Tax</td>
        <td id="taxtotal"></td>
        
    </tr>
    <tr>
        <td></td>
        <td>Other cost</td>
        <td>0.00</td>
        <td>Total</td>
        <td id="total"></td>
        
    </tr>
    <tr>
        <td></td>
        <td>Gross Profit</td>
        <td id="grossprofit"></td>
        <td></td>
        <td></td>
        
     
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <?php if($invoice->invoicetype==Invoice::TYPE_INVOICE):?>
        <td>Payment Applied</td>
        <td><?php echo number_format($invoice->getPaymentApplied(),2);?></td>   
        <?php endif?>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <?php if($invoice->invoicetype==Invoice::TYPE_INVOICE):?>
        <td>Balance due</td>
        <td><?php echo number_format($invoice->getBalanceDue(),2);?></td>   
        <?php endif?>
        
    </tr>

</table>
